package com.UI
{
	import com.*;
	import com.Engine.*;
	import com.Packet.*;
	
	import flash.display.*;
	import flash.events.*;
	import flash.external.*;
	import flash.filters.*;
	import flash.geom.*;
	import flash.system.*;
	import flash.text.*;
	import flash.ui.*;
	import flash.utils.*;
	
	import org.aswing.*;
	import org.aswing.border.*;
	import org.aswing.border.EmptyBorder;
	import org.aswing.colorchooser.*;
	import org.aswing.dnd.*;
	import org.aswing.event.*;
	import org.aswing.ext.*;
	import org.aswing.geom.*;
	import org.aswing.tree.AbstractLayoutCache;
	
	public class FrameBattleWatch extends JFrame
	{
		//members define
		private var panelImage:JPanel;
		private var btn_battle_watch_exit:JButton;
		
		public function FrameBattleWatch()
		{
			setClosable(false);
			setResizable(false);  
			setTitleBar(null);
			setBorder(new EmptyBorder());
			this.setBackgroundDecorator(new SolidBackground(new ASColor(0,0)));
			this.setClipMasked(false);
			this.getContentPane().setClipMasked(false);
			
			//component creation
			setSize(new IntDimension(250, 57));
			setPreferredSize(new IntDimension(250, 57));
			var layout0:EmptyLayout = new EmptyLayout();
			getContentPane().setLayout(layout0);
			
			panelImage = new JPanel();
			panelImage.setLocation(new IntPoint(0, 0));
			panelImage.setSize(new IntDimension(250, 29));
			panelImage.setPreferredSize(new IntDimension(250, 29));
			
			btn_battle_watch_exit = new JButton();
			btn_battle_watch_exit.setLocation(new IntPoint(100, 29));
			btn_battle_watch_exit.setSize(new IntDimension(49, 28));
			btn_battle_watch_exit.setPreferredSize(new IntDimension(49, 28));
			btn_battle_watch_exit.setText("label");
			
			//component layoution
			getContentPane().append(panelImage);
			getContentPane().append(btn_battle_watch_exit);
			
			img_battle_watch_bg = new AssetBackground(Client.getUIElement("img_battle_watch_bg") as DisplayObject);
			panelImage.setBackgroundDecorator(img_battle_watch_bg);
			setLocationXY((Engine.W - width) / 2,465);
			btn_battle_watch_exit.wrapSimpleButton(Client.getUIElement("btn_battle_watch_exit") as SimpleButton);
			btn_battle_watch_exit.setText("");
			btn_battle_watch_exit.addActionListener(onBtnBattleWatchExit);
		}
		
		private function onBtnBattleWatchExit(e:Event):void
		{
			Client.getInstance().sendPacketLogic(311,[0]);
		}
		private var img_battle_watch_bg:AssetBackground = null;
		
		public static var _frame:FrameBattleWatch = null;
		public static function show():void
		{
			if(_frame == null)
			{
				_frame = new FrameBattleWatch();
				PanelMainHelp.getInstance().addChild(_frame);
			}
			_frame.show();
			PanelMainHelp.getInstance().bringToTop(_frame);
			
		}
		public static function hide():void
		{
			if(isShowing())_frame.hide();
		}
		public static function isShowing():Boolean
		{
			return(_frame != null&& _frame.isShowing());
		}
	}
}